package com.atguigu.cloud.order.config;

import feign.RequestInterceptor;
import feign.RequestTemplate;
import org.springframework.stereotype.Component;

import java.util.Arrays;
import java.util.UUID;

/**
 * @author LT
 * @create 2023-11-14-18:07
 */
@Component
public class FeignRequestInterceptor implements RequestInterceptor {
    @Override
    public void apply(RequestTemplate requestTemplate) {
        System.out.println(requestTemplate.headers().get("token"));
        requestTemplate.header("token", Arrays.asList(UUID.randomUUID().toString()));
    }
}
